﻿<Activity mc:Ignorable="sap sap2010 sads" x:Class="SalesPortal.Activities.StateMachineNumberGuessWorkflow"
 xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
 xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:local="clr-namespace:SalesPortal.Activities"
 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 xmlns:mca="clr-namespace:Microsoft.CSharp.Activities;assembly=System.Activities"
 xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
 xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
 xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
 xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
 xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <x:Members>
    <x:Property Name="MaxNumber" Type="InArgument(x:Int32)" />
    <x:Property Name="Turns" Type="OutArgument(x:Int32)" />
  </x:Members>
  <sap2010:ExpressionActivityEditor.ExpressionActivityEditor>C#</sap2010:ExpressionActivityEditor.ExpressionActivityEditor>
  <sap2010:WorkflowViewState.IdRef>SalesPortal.Activities.StateMachineNumberGuessWorkflow_1</sap2010:WorkflowViewState.IdRef>
  <TextExpression.NamespacesForImplementation>
    <sco:Collection x:TypeArguments="x:String">
      <x:String>System</x:String>
      <x:String>System.Collections.Generic</x:String>
      <x:String>System.Data</x:String>
      <x:String>System.Linq</x:String>
      <x:String>System.Text</x:String>
    </sco:Collection>
  </TextExpression.NamespacesForImplementation>
  <TextExpression.ReferencesForImplementation>
    <sco:Collection x:TypeArguments="AssemblyReference">
      <AssemblyReference>Microsoft.CSharp</AssemblyReference>
      <AssemblyReference>System</AssemblyReference>
      <AssemblyReference>System.Activities</AssemblyReference>
      <AssemblyReference>System.Core</AssemblyReference>
      <AssemblyReference>System.Data</AssemblyReference>
      <AssemblyReference>System.Runtime.Serialization</AssemblyReference>
      <AssemblyReference>System.ServiceModel</AssemblyReference>
      <AssemblyReference>System.ServiceModel.Activities</AssemblyReference>
      <AssemblyReference>System.Xaml</AssemblyReference>
      <AssemblyReference>System.Xml</AssemblyReference>
      <AssemblyReference>System.Xml.Linq</AssemblyReference>
      <AssemblyReference>mscorlib</AssemblyReference>
      <AssemblyReference>SalesPortal.Activities</AssemblyReference>
    </sco:Collection>
  </TextExpression.ReferencesForImplementation>
  <StateMachine InitialState="{x:Reference __ReferenceID3}">
    <State x:Name="__ReferenceID3" DisplayName="Initialize Target">
      <State.Entry>
        <Assign>
          <Assign.To>
            <OutArgument x:TypeArguments="x:Int32">
              <mca:CSharpReference x:TypeArguments="x:Int32">Target</mca:CSharpReference>
            </OutArgument>
          </Assign.To>
          <Assign.Value>
            <InArgument x:TypeArguments="x:Int32">
              <mca:CSharpValue x:TypeArguments="x:Int32">new System.Random().Next(1, MaxNumber + 1)</mca:CSharpValue>
            </InArgument>
          </Assign.Value>
          <sap2010:WorkflowViewState.IdRef>Assign_1</sap2010:WorkflowViewState.IdRef>
        </Assign>
      </State.Entry>
      <State.Transitions>
        <Transition DisplayName="T1">
          <Transition.To>
            <State x:Name="__ReferenceID0" DisplayName="Enter Guess">
              <State.Entry>
                <WriteLine>
                  <InArgument x:TypeArguments="x:String">
                    <mca:CSharpValue x:TypeArguments="x:String">"Please enter a number between 1 and " + MaxNumber</mca:CSharpValue>
                  </InArgument>
                  <sap2010:WorkflowViewState.IdRef>WriteLine_1</sap2010:WorkflowViewState.IdRef>
                </WriteLine>
              </State.Entry>
              <State.Exit>
                <Assign>
                  <Assign.To>
                    <OutArgument x:TypeArguments="x:Int32">
                      <mca:CSharpReference x:TypeArguments="x:Int32">Turns</mca:CSharpReference>
                    </OutArgument>
                  </Assign.To>
                  <Assign.Value>
                    <InArgument x:TypeArguments="x:Int32">
                      <mca:CSharpValue x:TypeArguments="x:Int32">Turns + 1</mca:CSharpValue>
                    </InArgument>
                  </Assign.Value>
                  <sap2010:WorkflowViewState.IdRef>Assign_2</sap2010:WorkflowViewState.IdRef>
                </Assign>
              </State.Exit>
              <State.Transitions>
                <Transition DisplayName="Guess Correct">
                  <Transition.Trigger>
                    <local:ReadInt x:Name="__ReferenceID1" BookmarkName="EnterGuess">
                      <local:ReadInt.Result>
                        <OutArgument x:TypeArguments="x:Int32">
                          <mca:CSharpReference x:TypeArguments="x:Int32">Guess</mca:CSharpReference>
                        </OutArgument>
                      </local:ReadInt.Result>
                      <sap2010:WorkflowViewState.IdRef>ReadInt_1</sap2010:WorkflowViewState.IdRef>
                    </local:ReadInt>
                  </Transition.Trigger>
                  <Transition.Condition>
                    <mca:CSharpValue x:TypeArguments="x:Boolean">Guess == Target</mca:CSharpValue>
                  </Transition.Condition>
                  <Transition.To>
                    <State x:Name="__ReferenceID2" DisplayName="FinalState" IsFinal="True" sap2010:WorkflowViewState.IdRef="State_1" />
                  </Transition.To>
                  <sap2010:WorkflowViewState.IdRef>Transition_1</sap2010:WorkflowViewState.IdRef>
                </Transition>
                <Transition Trigger="{x:Reference __ReferenceID1}" DisplayName="Guess Incorrect" To="{x:Reference __ReferenceID0}">
                  <Transition.Action>
                    <If>
                      <If.Condition>
                        <InArgument x:TypeArguments="x:Boolean">
                          <mca:CSharpValue x:TypeArguments="x:Boolean">Guess &lt; Target</mca:CSharpValue>
                        </InArgument>
                      </If.Condition>
                      <If.Then>
                        <WriteLine Text="Your guess is too low." sap2010:WorkflowViewState.IdRef="WriteLine_2" />
                      </If.Then>
                      <If.Else>
                        <WriteLine Text="Your guess is too high." sap2010:WorkflowViewState.IdRef="WriteLine_3" />
                      </If.Else>
                      <sap2010:WorkflowViewState.IdRef>If_1</sap2010:WorkflowViewState.IdRef>
                    </If>
                  </Transition.Action>
                  <Transition.Condition>
                    <mca:CSharpValue x:TypeArguments="x:Boolean">Guess != Target</mca:CSharpValue>
                  </Transition.Condition>
                  <sap2010:WorkflowViewState.IdRef>Transition_2</sap2010:WorkflowViewState.IdRef>
                </Transition>
              </State.Transitions>
              <sap2010:WorkflowViewState.IdRef>State_2</sap2010:WorkflowViewState.IdRef>
            </State>
          </Transition.To>
          <sap2010:WorkflowViewState.IdRef>Transition_3</sap2010:WorkflowViewState.IdRef>
        </Transition>
      </State.Transitions>
      <sap2010:WorkflowViewState.IdRef>State_3</sap2010:WorkflowViewState.IdRef>
    </State>
    <x:Reference>__ReferenceID0</x:Reference>
    <x:Reference>__ReferenceID2</x:Reference>
    <StateMachine.Variables>
      <Variable x:TypeArguments="x:Int32" Name="Guess" />
      <Variable x:TypeArguments="x:Int32" Name="Target" />
    </StateMachine.Variables>
    <sap2010:WorkflowViewState.IdRef>StateMachine_1</sap2010:WorkflowViewState.IdRef>
    <sads:DebugSymbol.Symbol>d1NEOlxDb2RlcGxleFxTYWxlc1BvcnRhbFxTYWxlc1BvcnRhbC5BY3Rpdml0aWVzXFN0YXRlTWFjaGluZU51bWJlckd1ZXNzV29ya2Zsb3cueGFtbBctA5QBEgIBAS4FiwENAgEyQQ2FARUCAQRpFWmIAQIBAjAJPBICATVDEUgdAgEsSxFXGgIBIVwVYyUCARpmFWZjAgEVfxV/YwIBEG8VfBoCAQY4Dzh2AgE7Mw8zWgIBNkUVRYUBAgEtUxdTXQIBJ04XTmECASJcSVxVAgEgXxtfZQIBG3IbcmsCAQd2GXZyAgEOeRl5cwIBDHYpdkECAQ95KXlCAgEN</sads:DebugSymbol.Symbol>
  </StateMachine>
  <sap2010:WorkflowViewState.ViewStateManager>
    <sap2010:ViewStateManager>
      <sap2010:ViewStateData Id="Assign_1" sap:VirtualizedContainerService.HintSize="242,62" />
      <sap2010:ViewStateData Id="WriteLine_1" sap:VirtualizedContainerService.HintSize="211,62" />
      <sap2010:ViewStateData Id="Assign_2" sap:VirtualizedContainerService.HintSize="242,62" />
      <sap2010:ViewStateData Id="ReadInt_1" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="State_1" sap:VirtualizedContainerService.HintSize="114,61">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:Point x:Key="ShapeLocation">323,189.5</av:Point>
            <av:Size x:Key="ShapeSize">114,61</av:Size>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="Transition_1" sap:VirtualizedContainerService.HintSize="430,509">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:PointCollection x:Key="ConnectorLocation">164,221.5 194,221.5 194,220 323,220</av:PointCollection>
            <x:Int32 x:Key="SrcConnectionPointIndex">36</x:Int32>
            <x:Int32 x:Key="DestConnectionPointIndex">37</x:Int32>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="WriteLine_2" sap:VirtualizedContainerService.HintSize="211,62" />
      <sap2010:ViewStateData Id="WriteLine_3" sap:VirtualizedContainerService.HintSize="211,62" />
      <sap2010:ViewStateData Id="If_1" sap:VirtualizedContainerService.HintSize="464,212" />
      <sap2010:ViewStateData Id="Transition_2" sap:VirtualizedContainerService.HintSize="547,641">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:PointCollection x:Key="ConnectorLocation">164,221.5 191.3,221.5 191.3,282 101.3,282 101.3,252</av:PointCollection>
            <x:Int32 x:Key="SrcConnectionPointIndex">36</x:Int32>
            <x:Int32 x:Key="DestConnectionPointIndex">35</x:Int32>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="State_2" sap:VirtualizedContainerService.HintSize="114,61">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:Point x:Key="ShapeLocation">50,191</av:Point>
            <av:Size x:Key="ShapeSize">114,61</av:Size>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="Transition_3">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:PointCollection x:Key="ConnectorLocation">107,141 107,191</av:PointCollection>
            <x:Int32 x:Key="SrcConnectionPointIndex">39</x:Int32>
            <x:Int32 x:Key="DestConnectionPointIndex">38</x:Int32>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="State_3" sap:VirtualizedContainerService.HintSize="114,61">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <av:Point x:Key="ShapeLocation">50,80</av:Point>
            <av:Size x:Key="ShapeSize">114,61</av:Size>
            <x:Boolean x:Key="IsPinned">False</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="StateMachine_1" sap:VirtualizedContainerService.HintSize="614,636">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">False</x:Boolean>
            <av:Point x:Key="ShapeLocation">270,2.5</av:Point>
            <x:Double x:Key="StateContainerWidth">600</x:Double>
            <x:Double x:Key="StateContainerHeight">600</x:Double>
            <av:PointCollection x:Key="ConnectorLocation">300,77.5 300,110.5 164,110.5</av:PointCollection>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="SalesPortal.Activities.StateMachineNumberGuessWorkflow_1" sap:VirtualizedContainerService.HintSize="654,716" />
    </sap2010:ViewStateManager>
  </sap2010:WorkflowViewState.ViewStateManager>
</Activity>